package net.sky.oa.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 文档部门表
 * DocFileDept. @author hond
 */
@Entity
@Table(name = "DOC_FILE_DEPT")//文档部门表
public class DocFileDept implements Serializable{

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	private Long id;
	private DocFile file;//文档id
	private SysDept dept;  //部门id

	// Constructors

	/** default constructor */
	public DocFileDept() {
	}

	/** minimal constructor */
	public DocFileDept(Long id) {
		this.id = id;
	}
	@Id 
	@SequenceGenerator(name="SQ_DOCFILEDEPT_ID",sequenceName="SQ_DOCFILEDEPT_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_DOCFILEDEPT_ID")
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FILE_ID")
	public DocFile getFile() {
		return this.file;
	}

	public void setFile(DocFile file) {
		this.file = file;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DEPT_ID")
	public SysDept getDept() {
		return this.dept;
	}

	public void setDept(SysDept dept) {
		this.dept = dept;
	}

}